home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------------
- Paste together two pieces of a file name path
-
- Args: pathbuf -- Put the result here
- first_part -- of path name
- second_part -- of path name
-
- Result: New path is in pathbuf. No check is made for overflow. Note that
- we don't have to check for /'s at end of first_part and beginning
- of second_part since multiple slashes are ok.
-
- BUGS: This is a first stab at dealing with fs naming dependencies, and others
- still exist.
- ----*/
- void
- build_path(pathbuf, first_part, second_part)
- char *pathbuf, *first_part, *second_part;
- {
- if(!first_part)
- strcpy(pathbuf, second_part);
- else
- sprintf(pathbuf, "%s%s%s", first_part,
- (*first_part && first_part[strlen(first_part)-1] != '/')
- ? "/" : "",
- second_part);
- }
-
-
- /*----------------------------------------------------------------------
- Test to see if the given file path is absolute
-
- Args: file -- file path to test
-
- Result: TRUE if absolute, FALSE otw
-
- ----*/
- int
- is_absolute_path(path)
- char *path;
- {
- return(path && (*path == '/' || *path == '~'));
- }
-
-
-